<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var obj = { username: "zhangsan", gender: "男" };
      var obj0 = {
        username: "lisi",
        age: 18,
        fn() {
          console.log("刚满18岁");
        },
      };
      let res = Object.assign(obj, obj0);
      console.log(obj);
      console.log(obj0);
      console.log(res);
    </script>
  </body>
</html>
